/*
 * FXGL - JavaFX Game Library. The MIT License (MIT).
 * Copyright (c) AlmasB (almaslvl@gmail.com).
 * See LICENSE for details.
 */

package com.windea.study.kotlin.fxgl.sample.intermediate

import com.almasb.fxgl.app.*
import com.almasb.fxgl.dsl.*

/**
 * Example of loading resized textures.
 *
 * @author Almas Baimagambetov (AlmasB) (almaslvl@gmail.com)
 */
class DifferentSizeTextureSample : GameApplication() {
	override fun initSettings(settings: GameSettings) {}
	
	override fun initGame() {
		// the actual size of texture brick is 64x64
		
		entityBuilder()
			.at(200.0, 300.0)
			// 1. tell asset loader to load resized texture
			.view(getAssetLoader().loadTexture("brick.png", 32.0, 32.0))
			.buildAndAttach()
		
		entityBuilder()
			.at(300.0, 300.0)
			// you can also load with different ratio
			.view(getAssetLoader().loadTexture("brick.png", 64.0, 32.0))
			.buildAndAttach()
	}
}


fun main(args: Array<String>) {
	GameApplication.launch(DifferentSizeTextureSample::class.java, args)
}
